package com.mcc.myapplication

fun describe(obj: Any): String =
    when (obj) {
        1 -> "One"
        "Hello" -> "Greeting"
        is Long -> "Long"
        !is String -> "Not a string"
        else -> "Unknown"
    }

class Request(
    val url: String,
    val responseCode: Int
)



fun main() {
    println(describe(1))
    println(describe("Hello"))
    println(describe(1000L))
    println(describe(2))
    println(describe("other"))

    val x = 91
    val y = 90
    // 使用 in 操作符来检测某个数字是否在指定区间内
    // [1 , y+1]
    if (x in 1..y + 1) {
        println("fits in range")
    }

    for (i in 1..10 step 2) {
        print("$i ")
    }
    println()
    for (j in 9 downTo 0 step 3) {
        print("$j ")
    }
    println()


}